﻿@model WebUI.Areas.Bots.Models.BotFilters
@{
    Layout = MVC.Bots.Shared.Views._Main;
}
@section Title{@WebUI.Resources.BotFilters}
@section PageName{@WebUI.Resources.BotFilters}
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        ToggleDivs();
    });

    function ToggleDivs() {
        if ($('#AllDay').is(':checked')) {
            $('#SpecificHoursDiv :input').attr('disabled', true);
            $('#SpecificHoursDiv :input').val("");
        } else {
            $('#SpecificHoursDiv :input').removeAttr('disabled');
        }
    }

    function OpenHoursModal(data) {
        $('#SpecificHoursDialog').dialog('open');
    }
</script>
@using (Html.BeginForm(MVC.Bots.BotFilters.Save()))
{
    @Html.ValidationSummary(false)
    <div id="WizardSteps" class="filter_bar">
        <h3>@WebUI.Resources.BotFilters</h3>
        <div class="wizard_steps_form">
            @Html.LabelFor(model => model.MinOpsCount)
            @Html.EditorFor(model => model.MinOpsCount)
            @Html.ValidationMessageFor(model => model.MinOpsCount)
            @Html.LabelFor(model => model.MinFileSize)
            @Html.EditorFor(model => model.MinFileSize)
            @Html.ValidationMessageFor(model => model.MinFileSize)
            @Html.DropDownListFor(m => m.SelectedSize, Model.Sizes)
            @Html.LabelFor(model => model.Path)
            @Html.EditorFor(model => model.Path)
            @Html.ValidationMessageFor(model => model.Path)
            @Html.LabelFor(model => model.FileDirectoryName)
            @Html.EditorFor(model => model.FileDirectoryName)
            @Html.ValidationMessageFor(model => model.FileDirectoryName)
            @Html.LabelFor(model => model.FileExtension)
            @Html.EditorFor(model => model.FileExtension)
            @Html.ValidationMessageFor(model => model.FileExtension)
        </div>
        <h3>
            Filtering Hours per Day</h3>
        @Html.RadioButtonFor(m => m.AllHours, true, new { @Id = "AllDay", @onchange = "ToggleDivs();" })
        <span>All Day</span>
        <br />
        @Html.RadioButtonFor(m => m.AllHours, false, new { @onchange = "ToggleDivs();" })
        <span>Specific Hours</span>
        <div id="SpecificHoursDiv">
            @Html.TextBoxFor(m => m.PeriodHours, new { @readonly = "readonly" })
            @Html.ValidationMessageFor(model => model.PeriodHours)
        </div>
    </div>
    @Html.ActionLink(WebUI.Resources.Previous, MVC.Bots.Schedule.Index(), new { @class = "prev btn" })
    <input type="submit" class="next btn" value='@WebUI.Resources.Next' />
}
@{Html.RenderPartial(MVC.Bots.SpecificHours.Views.Modal, Model.PeriodHours);}
